package com.moyq5.mvc.maker.test.bean.entity;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicUpdate;

import com.moyq5.mvc.maker.test.bean.embed.TraChannelMerchFeeId;

/**
 * 渠道商户费率
 * @author Moyq5
 * @date 2017年12月12日
 */
@Entity
@Table(name = "tra_channel_merch_fee")
@DynamicUpdate
public class TraChannelMerchFee implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 渠道费率ID
	 */
	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "channelMerchId", column = @Column(name = "channel_merch_id", nullable = false, precision = 15, scale = 0)),
			@AttributeOverride(name = "feeId", column = @Column(name = "fee_id", nullable = false, precision = 15, scale = 0)) })
	private TraChannelMerchFeeId id;
	/**
	 * 渠道商户
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "channel_merch_id", nullable = false, insertable = false, updatable = false)
	private TraChannelMerch channelMerch;
	/**
	 * 费率
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "fee_id", nullable = false, insertable = false, updatable = false)
	private TraFee fee;
	public TraChannelMerchFeeId getId() {
		return id;
	}
	public void setId(TraChannelMerchFeeId id) {
		this.id = id;
	}
	public TraChannelMerch getChannelMerch() {
		return channelMerch;
	}
	public void setChannelMerch(TraChannelMerch channelMerch) {
		this.channelMerch = channelMerch;
	}
	public TraFee getFee() {
		return fee;
	}
	public void setFee(TraFee fee) {
		this.fee = fee;
	}
}
